import os
import tensorflow as tf
from .streamer import Oulu_NPU, OneLabelData, HomeMadeData

opj = os.path.join

OULU_PATH  = "/home/jh/working_data/anti-spoofing/Oulu_NPU"
HOTEL_PATH = "/home/jh/working_data/anti-spoofing/hotel_cheating"
MSU_LIVE_PATH = "/home/jh/working_data/anti-spoofing/MSU_USSA_Public"
MSU_SPOOF_PATH = "/home/jh/working_data/anti-spoofing/MSU_USSA_Public/SpoofSubjectImages"
HOME_MADE_PATH = "/home/jh/working_data/anti-spoofing/HomeMadeData"

###############hotel dataset
HOTEL_TRAIN_POS_PATH = opj( HOTEL_PATH , "train_pos" )
HOTEL_TRAIN_NEG_PATH = opj( HOTEL_PATH , "train_neg" )
HOTEL_TEST_POS_PATH = opj( HOTEL_PATH , "test_pos" )
HOTEL_TEST_NEG_PATH = opj( HOTEL_PATH , "test_neg" )

################MSU dataset
MSU_LIVE_TRAIN_PATH = opj( MSU_LIVE_PATH , "train_LiveSubjectsImages" )
MSU_SPOOF_TRAIN1_PATH = opj( MSU_SPOOF_PATH , "train_MacBook_FrontCamera" )
MSU_SPOOF_TRAIN2_PATH = opj( MSU_SPOOF_PATH , "train_MacBook_RearCamera" )
MSU_SPOOF_TRAIN3_PATH = opj( MSU_SPOOF_PATH , "train_Nexus_FrontCamera" )
MSU_SPOOF_TRAIN4_PATH = opj( MSU_SPOOF_PATH , "train_Nexus_RearCamera" )
MSU_SPOOF_TRAIN5_PATH = opj( MSU_SPOOF_PATH , "train_PrintedPhoto_FrontCamera" )
MSU_SPOOF_TRAIN6_PATH = opj( MSU_SPOOF_PATH , "train_PrintedPhoto_RearCamera" )
MSU_SPOOF_TRAIN7_PATH = opj( MSU_SPOOF_PATH , "train_Tablet_FrontCamera" )
MSU_SPOOF_TRAIN8_PATH = opj( MSU_SPOOF_PATH , "train_Tablet_RearCamera" )

MSU_LIVE_TEST_PATH = opj( MSU_LIVE_PATH , "test_LiveSubjectsImages" )
MSU_SPOOF_TEST1_PATH = opj( MSU_SPOOF_PATH , "test_MacBook_FrontCamera" )
MSU_SPOOF_TEST2_PATH = opj( MSU_SPOOF_PATH , "test_MacBook_RearCamera" )
MSU_SPOOF_TEST3_PATH = opj( MSU_SPOOF_PATH , "test_Nexus_FrontCamera" )
MSU_SPOOF_TEST4_PATH = opj( MSU_SPOOF_PATH , "test_Nexus_RearCamera" )
MSU_SPOOF_TEST5_PATH = opj( MSU_SPOOF_PATH , "test_PrintedPhoto_FrontCamera" )
MSU_SPOOF_TEST6_PATH = opj( MSU_SPOOF_PATH , "test_PrintedPhoto_RearCamera" )
MSU_SPOOF_TEST7_PATH = opj( MSU_SPOOF_PATH , "test_Tablet_FrontCamera" )
MSU_SPOOF_TEST8_PATH = opj( MSU_SPOOF_PATH , "test_Tablet_RearCamera" )

################# Home made dataset
HOMEMADE_LIVE_TRAIN_PATH = opj( HOME_MADE_PATH , "made_by_real_access_high_reso" , \
        "train" )
HOMEMADE_SPOOF_TRAIN1_PATH = opj( HOME_MADE_PATH , "made_by_CRXs_iPhone_MyJianguo3", \
        "train" )
HOMEMADE_SPOOF_TRAIN2_PATH = opj( HOME_MADE_PATH , "made_by_CRXs_iPhone_ZCCiPhone", \
        "train" )
HOMEMADE_SPOOF_TRAIN3_PATH = opj( HOME_MADE_PATH , "made_by_printed_MyJianguo3", \
        "train" )

HOMEMADE_LIVE_TEST_PATH = opj( HOME_MADE_PATH , "made_by_real_access_high_reso" , \
        "test" )
HOMEMADE_SPOOF_TEST1_PATH = opj( HOME_MADE_PATH , "made_by_CRXs_iPhone_MyJianguo3", \
        "test" )
HOMEMADE_SPOOF_TEST2_PATH = opj( HOME_MADE_PATH , "made_by_CRXs_iPhone_ZCCiPhone", \
        "test" )
HOMEMADE_SPOOF_TEST3_PATH = opj( HOME_MADE_PATH , "made_by_printed_MyJianguo3", \
        "test" )


###############   data ops
oulu_train_ops = Oulu_NPU( OULU_PATH ).trainDataStream( 32 )
oulu_test_ops  = Oulu_NPU( OULU_PATH ).testDataStream( 128 )

hotel_train_pos_ops = OneLabelData( HOTEL_TRAIN_POS_PATH , \
        label = 0 ).testDataStream( 50 )
hotel_train_neg_ops = OneLabelData( HOTEL_TRAIN_NEG_PATH , \
        label = 1 ).testDataStream( 50 )
hotel_test_pos_ops = OneLabelData( HOTEL_TEST_POS_PATH , \
        label = 0 ).testDataStream( 64 )
hotel_test_neg_pos = OneLabelData( HOTEL_TEST_NEG_PATH , \
        label = 1 ).testDataStream( 64 )


msu_live_train_ops = OneLabelData( MSU_LIVE_TRAIN_PATH , \
        label = 0 ).testDataStream( 48 )
msu_spoof_train1_ops = OneLabelData( MSU_SPOOF_TRAIN1_PATH , \
        label = 1 ).testDataStream( 12 )
msu_spoof_train2_ops = OneLabelData( MSU_SPOOF_TRAIN2_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_train3_ops = OneLabelData( MSU_SPOOF_TRAIN3_PATH , \
        label = 1 ).testDataStream( 12 )
msu_spoof_train4_ops = OneLabelData( MSU_SPOOF_TRAIN4_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_train5_ops = OneLabelData( MSU_SPOOF_TRAIN5_PATH , \
        label = 1 ).testDataStream( 12 )
msu_spoof_train6_ops = OneLabelData( MSU_SPOOF_TRAIN6_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_train7_ops = OneLabelData( MSU_SPOOF_TRAIN7_PATH , \
        label = 1 ).testDataStream( 12 )
msu_spoof_train8_ops = OneLabelData( MSU_SPOOF_TRAIN8_PATH , \
        label = 1 ).testDataStream( 64 )

msu_live_test_ops = OneLabelData( MSU_LIVE_TEST_PATH , \
        label = 0 ).testDataStream( 64 )
msu_spoof_test1_ops = OneLabelData( MSU_SPOOF_TEST1_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test2_ops = OneLabelData( MSU_SPOOF_TEST2_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test3_ops = OneLabelData( MSU_SPOOF_TEST3_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test4_ops = OneLabelData( MSU_SPOOF_TEST4_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test5_ops = OneLabelData( MSU_SPOOF_TEST5_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test6_ops = OneLabelData( MSU_SPOOF_TEST6_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test7_ops = OneLabelData( MSU_SPOOF_TEST7_PATH , \
        label = 1 ).testDataStream( 64 )
msu_spoof_test8_ops = OneLabelData( MSU_SPOOF_TEST8_PATH , \
        label = 1 ).testDataStream( 64 )


homemade_live_train_ops = OneLabelData( HOMEMADE_LIVE_TRAIN_PATH , \
        label = 0 ).testDataStream( 8 )
homemade_spoof_train1_ops = OneLabelData( HOMEMADE_SPOOF_TRAIN1_PATH , \
        label = 1 ).testDataStream( 8 )
homemade_spoof_train2_ops = OneLabelData( HOMEMADE_SPOOF_TRAIN2_PATH , \
        label = 1 ).testDataStream( 8 )
homemade_spoof_train3_ops = OneLabelData( HOMEMADE_SPOOF_TRAIN3_PATH , \
        label = 1 ).testDataStream( 8 )

homemade_live_test_ops = OneLabelData( HOMEMADE_LIVE_TEST_PATH , \
        label = 0 ).testDataStream( 8 )
homemade_spoof_test1_ops = OneLabelData( HOMEMADE_SPOOF_TEST1_PATH , \
        label = 1 ).testDataStream( 8 )
homemade_spoof_test2_ops = OneLabelData( HOMEMADE_SPOOF_TEST2_PATH , \
        label = 1 ).testDataStream( 8 )
homemade_spoof_test3_ops = OneLabelData( HOMEMADE_SPOOF_TEST3_PATH , \
        label = 1 ).testDataStream( 8 )

oulu_writer = tf.summary.FileWriter( './tflog/oulu' )
hotel_pos_writer = tf.summary.FileWriter( './tflog/hotel_pos' )
hotel_neg_writer = tf.summary.FileWriter( './tflog/hotel_neg' )
msu_live_writer = tf.summary.FileWriter( './tflog/msu_live' )
msu_spoof1_writer = tf.summary.FileWriter( './tflog/msu_spoof1' )
msu_spoof2_writer = tf.summary.FileWriter( './tflog/msu_spoof2' )
msu_spoof3_writer = tf.summary.FileWriter( './tflog/msu_spoof3' )
msu_spoof4_writer = tf.summary.FileWriter( './tflog/msu_spoof4' )
msu_spoof5_writer = tf.summary.FileWriter( './tflog/msu_spoof5' )
msu_spoof6_writer = tf.summary.FileWriter( './tflog/msu_spoof6' )
msu_spoof7_writer = tf.summary.FileWriter( './tflog/msu_spoof7' )
msu_spoof8_writer = tf.summary.FileWriter( './tflog/msu_spoof8' )
homemade_live_writer = tf.summary.FileWriter( './tflog/homemade_live' )
homemade_spoof1_writer = tf.summary.FileWriter( './tflog/homemade_spoof1' )
homemade_spoof2_writer = tf.summary.FileWriter( './tflog/homemade_spoof2' )
homemade_spoof3_writer = tf.summary.FileWriter( './tflog/homemade_spoof3' )
